
INCLUDE(FindPythonLibs)
INCLUDE(FindBoost)

FIND_PATH (CXXLIB_INCLUDE_PATH CXXlib.h ${CMAKE_INCLUDE_PATH})

FIND_LIBRARY (CXXLIB_PATH CXX ${CMAKE_LIBRARY_PATH_PATH})
FIND_LIBRARY (BOOST_PYTHON_PATH boost_python ${CMAKE_LIBRARY_PATH_PATH} ${Boost_LIBRARIES})

INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_PATH}
${CXXLIB_INCLUDE_PATH}
)

SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

ADD_LIBRARY (CXXlib SHARED pyCXXlib.cc)
TARGET_LINK_LIBRARIES (CXXlib
	${CXXLIB_PATH}
	${BOOST_PYTHON_PATH}
	${PYTHON_LIBRARIES}
	)
SET_TARGET_PROPERTIES(CXXlib PROPERTIES OUTPUT_NAME _pyCXXlib)

INSTALL(TARGETS CXXlib
  DESTINATION ${PYTHON_DESTINATION}/pyCXXlib
  PERMISSIONS OWNER_WRITE
  OWNER_READ GROUP_READ WORLD_READ
  OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
)